import { HttpService } from 'src/app/shared/service/http.service';
import { HttpClient } from '@angular/common/http';
import { PageModalService } from 'src/app/shared/service/page-modal-service';
import { Component, Input, OnInit } from '@angular/core';

@Component({
  selector: 'app-list-of-house-plans',
  templateUrl: './list-of-house-plans.component.html',
  styleUrls: ['./list-of-house-plans.component.scss'],
})
export class ListOfHousePlansComponent implements OnInit {
 @Input() tagData: any;
  currenIndex = 0;
  constructor(
    private  pageModalService: PageModalService,
    private httpService: HttpService

  ) { }

  ngOnInit() {}

  onClick(link) {
    this.pageModalService.openPage(link);
  }
  filterClick(item, i) {
    this.currenIndex = i;
    const params = {
      content: item.content,
      id: item.id,
      sessionId: localStorage.getItem("sessionId")
    };
    this.httpService.post("application/submit", params, res => {

      if (res.success && res.data && res.data.data) {
        this.tagData.data = res.data.data;
      }
    });
  }
}
